<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>Example</title>
<script src="/aiot/aiotapp/static/amrPlayer-jsdemo/js/voice-2.0.js"></script>
</head>
<body>
<input type="button" value="play" id="playId"/>
<input type="button" value="stop" id="stopId"/>
</body>
<script type="text/javascript">

//初始化
RongIMLib.RongIMVoice.init();
//播放
document.getElementById("playId").onclick = function(){
　　 // base64Str ： amr 格式的 base64 码，可以用 HTML5 FileReader 或者canvas 进行转换 。 
　　 var base64Str = "IyFBTVIKLJ7AfAD/Afy5oy9QiyYvs/WDYK9SLJ7AfAD/Afy5oy9QiyYvs/WDYK9SLJ7AfAD/Afy5oy9QiyYvs/WDYK9SLJajmgaAQVs0lLoG6rDz0eAQQvlQLHXtHBaBjVSZqan4AIGXxendJGDILF1FjhwkACxiG3a9g8t3qyHvsEt8LFyYwB4AsdCVYnW46Dh+w2loBLYsrxyOFLA7FK6ipHOHjyfzRX+RYgYsTyqYGGCVIaTYKHcfXLys+pFOzp4slhaCFKSq0Wtm20jTwxfPvwvbSYYspUWOGkFboUGiPvQcAeEdbYxRxyIskqMyAfA5kD5UvZde/K1sd0zlyc4sl8GOA8CGHCoZemKDYuzgYttwLF1FMhLAhGuBHuoiTndvrRtoBGKqLJMGjhDgCJOAUtw9V1tKbWBLlz8eLGsQMhDgSHs6NtOk3c/bmH8UikvULKERjgWhEMQyM2AGpATg+5qpR64oLJajjgHgCmYdQkF2nKaa/ch0lK2GLF4AjhDiAGGkknSK6So/Xwx35UmCLMUczAPAAC7FQwoZLId2ccYX9fQyLJkctAPBFBzwQv64/jwFU2dzw4W0LJGp/ADgHMDeTeq7K5mj4bjJbPBeLKQZYAPAAAblAfbMt0cTx3D5zAMOLJYYMgOAOt8Vh0FMjSRqzrABFWlaLKEGThDiKBLFF/JHWtSbb3OYb/yALJccMgHgX/tTJ1KzMHgVQsV1EtpyLJMGjgWhV1zoa4ThhSa2zOCysfbyLKYAHBDgBX6o4dCtXm1TJllVQ6kyLJcGmh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abo4HgCKbPMKTiliaBrePSDuoRCzGXzAWwAAJI5FrdJi2mvTwgHnuZizhhUgeATH0860SxJlK1NVZHGkJxCzpJ/AeRmuE2g5CkeuS1Eszb9vekCzoCvIeiBZ+dwRteot+pffhYqeUEizpysIfQAL2SwntNP5RYEjWFPIH2izZCswfUD5eCDNjnknTQzJd3UVo5CzpC4YfwSozUktkBs3vw95TZPwvdizt51AepE1mU8EFqOgeZ7ElMwRG/iyawCyXaRAMBsb6uUNs9lS1zarYFg==";

    RongIMLib.RongIMVoice.play(base64Str );
};
//暂停
document.getElementById("stopId").onclick = function(){ RongIMLib.RongIMVoice.stop(); }; 

</script> 

</html>